//
//  YXJMusicPlayController.m
//  Piece
//
//  Created by dllo on 16/6/17.
//  Copyright © 2016年 Northeast Dianli University. All rights reserved.
//

#import "YXJMusicPlayController.h"

@interface YXJMusicPlayController ()

@property (nonatomic, strong) UILabel *titleLable;

@property (nonatomic, strong) UILabel *nameLabel;

@property (nonatomic, strong) UIButton *playButton;

@property (nonatomic, strong) UIButton *lastButton;

@property (nonatomic, strong) UIButton *nextButton;

@property (nonatomic, strong) UIButton *xunhuanButton;

@property (nonatomic, strong) UIButton *musicButton;

@property (nonatomic, strong) UIButton *infoButton;

@end

@implementation YXJMusicPlayController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatMusicView];
}

- (void)creatMusicView{
    self.titleLable = [[UILabel alloc] initWithFrame:CGRectMake(100, 10, ScreenWidth - 200, 20)];
    self.titleLable.backgroundColor = [UIColor cyanColor];
    [self.view addSubview:_titleLable];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 25, 100, 50, 20)];
    self.nameLabel.backgroundColor = [UIColor cyanColor];
    [self.view addSubview:_nameLabel];
    
    self.lastButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.lastButton.frame = CGRectMake(50, 130, 44, 44);
    [self.lastButton addTarget:self action:@selector(didLastButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.lastButton setImage:[UIImage imageNamed:@"previous_normal"] forState:UIControlStateNormal];
    [self.view addSubview:_lastButton];
    
    self.playButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.playButton.frame = CGRectMake(ScreenWidth / 2 - 25, 130, 44, 44);
    [self.playButton addTarget:self action:@selector(didPlayButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.playButton setImage:[UIImage imageNamed:@"play_normal"] forState:UIControlStateNormal];
    [self.view addSubview:_playButton];
    
    self.nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.nextButton.frame = CGRectMake(ScreenWidth - 100, 130, 44, 44);
    [self.nextButton addTarget:self action:@selector(didNextButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.nextButton setImage:[UIImage imageNamed:@"next_nromal"] forState:UIControlStateNormal];
    [self.view addSubview:_nextButton];
    
    self.xunhuanButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.xunhuanButton.frame = CGRectMake(20, 200, 44, 44);
    [self.xunhuanButton setImage:[UIImage imageNamed:@"player_all_cycle"] forState:UIControlStateNormal];
    [self.view addSubview:_xunhuanButton];
    
    self.musicButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.musicButton.frame =  CGRectMake(260, _xunhuanButton.frame.origin.y, 44, 44);
    [self.musicButton setImage:[UIImage imageNamed:@"music_collection"] forState:UIControlStateNormal];
    [self.view addSubview:_musicButton];
    
    self.infoButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.infoButton.frame = CGRectMake(ScreenWidth - 64, _musicButton.frame.origin.y, 44, 44);
    [self.infoButton setImage:[UIImage imageNamed:@"detail_content"] forState:UIControlStateNormal];
    [self.view addSubview:_infoButton];
}


- (void)didLastButton:(UIButton *)sender
{
    NSLog(@"点击了按钮");
}

- (void)didPlayButton:(UIButton *)sender
{
    NSLog(@"点击了按钮");
}

- (void)didNextButton:(UIButton *)sender
{
    NSLog(@"点击了next");
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
